cmake_minimum_required(VERSION 3.21)
project(xeno_manifold)

set(CMAKE_CXX_STANDARD 20)

add_executable(xeno_manifold src/main.cpp
        src/LiftStretch.cpp
        src/LiftStretch.h
        src/ShiftSuck.cpp
        src/ShiftSuck.h
        src/Arm.cpp
        src/Arm.h
)

add_executable(xeno_test src/test.cpp
        src/LiftStretch.cpp
        src/LiftStretch.h
        src/ShiftSuck.cpp
        src/ShiftSuck.h
        src/Arm.cpp
        src/Arm.h
)

#MotorMaster
set(COMPILE_MM_EXAMPLE OFF)
set(MM_DISABLE_LOG ON)
add_subdirectory(3rdparty/motor-master)
target_include_directories(xeno_manifold PRIVATE 3rdparty/motor-master/include)
target_include_directories(xeno_manifold PRIVATE 3rdparty/serialib/lib)
target_include_directories(xeno_test PRIVATE 3rdparty/motor-master/include)
target_include_directories(xeno_test PRIVATE 3rdparty/serialib/lib)

# serial lib
add_library(serialib SHARED 3rdparty/serialib/lib/serialib.cpp)

#OnePacket
set(COMPILE_OP_EXAMPLE OFF)
set(COMPILE_OP_CTEST OFF)
add_subdirectory(3rdparty/one-packet)
target_link_libraries(xeno_manifold PRIVATE OnePacket)
target_link_libraries(xeno_manifold PRIVATE MotorMaster)
target_link_libraries(xeno_manifold PRIVATE serialib)

target_link_libraries(xeno_test PRIVATE OnePacket)
target_link_libraries(xeno_test PRIVATE MotorMaster)
target_link_libraries(xeno_test PRIVATE serialib)